package com.konne.nightmare.FastPublicOpinion.mvp.presenter;

import android.os.Handler;

import com.konne.nightmare.FastPublicOpinion.Event;
import com.konne.nightmare.FastPublicOpinion.R;
import com.konne.nightmare.FastPublicOpinion.base.BaseMvpPresenter;
import com.konne.nightmare.FastPublicOpinion.mvp.view.IMoveGroupView;

import org.greenrobot.eventbus.EventBus;

import java.util.ArrayList;
import java.util.List;

/**
 * Create by ws.
 * on Data:2022/1/26  Time:上午 10:22.
 * description: ** .
 */
public class MoveGroupPresenter extends BaseMvpPresenter<IMoveGroupView> {

    public void init(){
        List<GroupBean> datas=new ArrayList<>();
        GroupBean d=new GroupBean();
        d.studentNum=3;
        d.title="分组1";
        datas.add(d);
        d=new GroupBean();
        d.studentNum=3;
        d.title="分组1";
        datas.add(d);
        getView().updataGroupData(datas);
    }

    public void submit() {
        EventBus.getDefault().post(new Event.CloseMoveStudentView());
        new Handler().postDelayed(new Runnable() {
            @Override
            public void run() {
                getView().endSubmit();
            }
        },500);
    }

    public static class GroupBean{
        public String title;
        public int studentNum;
    }
}
